#include<bits/stdc++.h>
using namespace std;
int main(){
	int T;
	while(cin >> T){
	int s;
	if(T <= 3500){
		cout << T << endl;
		return 0;
	} 
	if(T >= 61005)
		s = (T - 61005)/0.55 + 80000;	
	else if (T >= 44755)
		s = (T - 44755)/0.65 + 55000;
	else if (T >= 30755)
		s = (T - 30755)/0.7 + 35000;
	else if (T >= 11255)
		s = (T - 11255)/0.75 + 9000;
	else if (T >= 7655)
		s = (T - 7655)/0.8 + 4500;
	else if(T >= 4955)
		s = (T - 4955)/0.9 + 1500;
	else if (T > 3500)
		s = (T-3500)/0.97;
	
	s += 3500;
	cout << s << endl;	
	}
	return 0;
}
